package main

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"github.com/prometheus/client_golang/prometheus/promhttp"
	"go-learn/go_learn/prometheus/handler"
)

func main() {
	r := gin.New()
	r.GET("metrics", gin.WrapH(promhttp.Handler()))

	api := r.Group("api").Use(handler.MwPrometheusHttp)
	api.GET("/hello", func(context *gin.Context) {
		fmt.Println("hello world!")
	})

	r.Run(":8080")
}
